package lulin.w09.service;

import lulin.w09.dao.TeacherDaoInterface;
import lulin.w09.entity.Teacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherService implements TeacherServiceInterface {

    @Autowired
    private TeacherDaoInterface teacherDao;

    @Override
    public Long addTeacher(Teacher teacher) {
        return teacherDao.addTeacher(teacher);
    }

    @Override
    public int deleteTeacher(Long id) {
        return teacherDao.deleteTeacher(id);
    }

    @Override
    public int updateTeacher(Teacher teacher) {
        return teacherDao.updateTeacher(teacher);
    }

    @Override
    public Teacher getTeacher(Long id) {
        return teacherDao.getTeacher(id);
    }

    @Override
    public List<Teacher> getAllTeachers() {
        return teacherDao.getAllTeachers();
    }

    @Override
    public List<Teacher> getTeachersBySchoolId(Long schoolId) {
        return teacherDao.getTeachersBySchoolId(schoolId);
    }

    @Override
    public List<Teacher> getTeachersByDepartmentId(Long departmentId) {
        return teacherDao.getTeachersByDepartmentId(departmentId);
    }
}    